package com.ding.easycontroller.dao.impl;

import com.ding.easycontroller.dao.ControllerDao;
import com.ding.easycontroller.file.ControllerFile;
import com.ding.easycontroller.work.Controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;


/*

    直接和文件系统进行交互

    仅用来存储实体,不提供任何功能


 */
@Repository
public class ControllerDaoImpl implements ControllerDao {


    @Autowired
    private ControllerFile controllerFile;

    @Override
    public List<Controller> listAll() {
        return controllerFile.listAll();
    }

    @Override
    public void add(Controller controller) {
        controllerFile.add(controller);
    }

    @Override
    public void update(Controller controller) {
        controllerFile.update(controller);
    }

    @Override
    public void removeById(String id) {
        controllerFile.removeById(id);
    }


}
